package com.sitech.ibnms.c3p.command.shell;

import java.io.File;
import java.util.Arrays;

/**
 * Created by leo on 16/2/17.
 */
public interface ShellExecutor extends Cloneable {

    class Result {
        public final int status;
        public final byte[] out;

        public Result(int status, byte[] out) {
            this.status = status;
            this.out = out;
        }

        @Override
        public String toString() {
            return "执行返回状态: " + status + "\n脚本执行输出: \n" + (out.length < 5 ? Arrays.toString(out) : new String(out));
        }
    }

    Result execRemote(String command);

    Result scpToRemote(File localFile, String remotePath);
}
